{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "67517e22",
   "metadata": {},
   "source": [
    "## 判断当前是一周中的星期几？如果是星期二，看下几点，是否在python课ing？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "074cf90b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d4505a98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime().tm_wday"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "9c0040ed",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "今天下午2：30-4：50有python课\n"
     ]
    }
   ],
   "source": [
    "今天 = time.localtime().tm_wday\n",
    "if 今天 == 1:\n",
    "    print(\"今天下午2：30-4：50有python课\")\n",
    "else:\n",
    "    print(\"今天下午没有python课\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f6232cf4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "1a6ff58b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime().tm_hour"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "56085a30",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肯定不在python课\n",
      "no class learning\n"
     ]
    }
   ],
   "source": [
    "现在 = time.localtime().tm_hour\n",
    "if 现在 == 14:\n",
    "    print(\"可能在python课\")\n",
    "else:\n",
    "    print(\"肯定不在python课\")\n",
    "now = time.localtime().tm_min\n",
    "if now > 30:\n",
    "    print(\"python课ing\")\n",
    "else:\n",
    "    print(\"no class learning\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7200651e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "610ff118",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime().tm_hour"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "f3a055fa",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "不在pytho课ing\n",
      "python课ing\n"
     ]
    }
   ],
   "source": [
    "现在 = time.localtime().tm_hour\n",
    "if 现在 == 16:\n",
    "    print(\"可能python课ing\")\n",
    "else:\n",
    "    print(\"不在pytho课ing\")\n",
    "now = time.localtime().tm_min\n",
    "if now < 50:\n",
    "    print(\"python课ing\")\n",
    "else: \n",
    "    print(\"no class learning\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "092dc6c3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e563e37",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
